package com.webbei.HAO.action;

import java.io.IOException;

import org.apache.struts2.ServletActionContext;

import com.webbei.HAO.service.ChSer;

public class checkMailAction {
		 private String email;
		 private ChSer ser;
		public String execute(){
			System.out.println("email:"+email);
			int count =ser.checkEmail(email);
			System.out.println("count:"+count);
			if(count>0){
				try {
					ServletActionContext.getResponse().getWriter().write("success");
					ServletActionContext.getResponse().setContentType("text/html");
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				
			}else{
				try {
					ServletActionContext.getResponse().getWriter().write("fail");
					ServletActionContext.getResponse().setContentType("text/html");
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			return null;
		}
		public String getEmail() {
			return email;
		}
		public void setEmail(String email) {
			this.email = email;
		}
		public ChSer getSer() {
			return ser;
		}
		public void setSer(ChSer ser) {
			this.ser = ser;
		}
		
		
}
